package com.eirikb.shared.events;

import com.eirikb.client.Client;

/**
 *
 * @author eirikb
 */
public class ErrorEvent extends Event {

    private int num;
    private String error;

    public ErrorEvent(int num, String error) {
        this.num = num;
        this.error = error;
    }

    public void execute(Client client) {
        String msg = "Ukjent feil (" + num + "): " + error;
        if (client.isLoggedIn()) {
            client.getLogin().setInfo(msg);
        } else {
            client.getChat().addChat("* " + msg);
        }
    }
}
